import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useMenuStore = defineStore('menu', () => {
    let children = ref([])
    let menu = ref([])
    let routers = ref([])
    function $reset() {
        children.value = []
        menu.value = []
        routers.value = []
    }
    function length(){
        return menu.value.length === 0
    }
    return {
        children,
        menu,
        $reset,
        routers,
        length
    }
},
    {
        persist: [{
            storage: sessionStorage
        }]
    })